// function doSomething(x: string | null) {
//     console.log(x.toUpperCase());
// }

function doSomething(x: string | null) {
    if (x === null) {
        // do nothing
    } else {
        console.log(x.toUpperCase());
    }
}

function liveDangerously(x?: number | null) {
    // No error
    console.log(x!.toFixed())
}